package com.anttribe.components.db.executor.formatter;

import java.sql.Types;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zhaoyong
 * @date 2023/1/14 0014
 */
@MappedTypes(type = Types.TIME)
public class TimeDataFormatter extends BaseTypeDataFormatter<Date> {

    /**
     * 默认时间格式化字符串
     */
    private static final String DEFAULT_TIME_FORMAT_PATTERN = "HH:mm:ss";

    @Override
    protected String formatNotNull(Date data) {
        SimpleDateFormat dateFormat = new SimpleDateFormat(DEFAULT_TIME_FORMAT_PATTERN);
        return dateFormat.format(data);
    }

}
